package com.itrip.controller;

import com.itrip.dto.ResponseDTO;
import com.itrip.dto.RoomDTO;
import com.itrip.service.RoomService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;

@Api(tags = "房间接口")
@RestController
public class RoomController {

    @Resource
    private RoomService roomService;



    @ApiOperation("酒店房间库存及价格")
    @PostMapping("/selectRoomStore")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "hotelId",value = "酒店id",example = "1",required = true),
            @ApiImplicitParam(name = "roomId",value = "房间id",example = "4",required = true)
    })
    public ResponseDTO selectRoomStore(@RequestParam int hotelId, @RequestParam int roomId) {
        List<RoomDTO> roomDTOList=roomService.selectRoomStore(hotelId,roomId);
        return new ResponseDTO(100,"查询成功",roomDTOList);
    }
}
